Tutorial

Scratch to Flop

Motion

Scratch Flop
move(10)steps sprite.moveSteps(10);
turn right(15)degrees sprite.turnRight(15);
turn left(15)degrees sprite.turnLeft(15);
go to(random position v) sprite.goTo("random");
go to x:(200) y:(100) sprite.goToXY(200,100);
glide (1) secs to (random position v) sprite.glideTo("random",1);
glide (1) secs to x:(200)y:(100) sprite.glide(200,100,1);
point in direction(90) sprite.pointInDirection(90);
point towards(this sprite v) sprite.pointTowards(thisSprite);
change x by(10) sprite.changeX(10);
set x to(10) sprite.setX(10);
change y by(10) sprite.changeY(10);
set y to(10) sprite.setY(10);
set rotation style [left-right v] sprite.setRotationStyle("left-right")
if on edge, bounce Not implemented
(x position) sprite.getX()
(y position) sprite.getY()
(direction) sprite.getDir()

Looks

Scratch Flop
say[Hello!]for(2)seconds Not implemented
say[Hello!] Not implemented
think[Hmm...]for(2)seconds Not implemented
think[Hmm...] Not implemented
switch costume to(costume1 v) sprite.setCostume(0);
next costume sprite.nextCostume();
switch backdrop to(backdrop1 v) flop.setBackdrop("/path/to/backdrop1","vector/bitmap");
next backdrop See above
change size by (10) sprite.changeSize(10);
set size to [100%] sprite.setSize(100);
change [color v] effect by(25) sprite.changeEffect("colour",25);
set [color v] effect to(0) sprite.setEffect("colour",0);
clear graphic effects sprite.clearEffects();
show sprite.show();
hide sprite.hide()
go to [front v] layer sprite.goToLayer("front")
go [foward v] (1) layers sprite.changeLayers(1)
(costume [number v]) sprite.costumeNumber(); //"name" unimplemented
(backdrop [number v]) See backdrop blocks
(size) sprite.size();

Sound

Sound blocks are implemented using a different meathod, with one flop.playSound(pan,pitch,volume,"/path/to/sound/file"); command. pan is a range from -100 (left) to 100 (right). Both pitch and volume are a range from 0 to 100.

Control

Many contol blocks are acctually built into Javascript
Scratch Flop
wait(1)seconds await flop.waitSeconds(1);
repeat(10) ... See Javascript for loops
forever ... See Javascript while(true) loops
if <> then end if<>then else See Javascript if conditions
wait until <condition> flop.waiUntil(()=>condition)
repeat until <> See Javascript while(!) loops
stop [all v] See javascript return statements
when i start as a clone Coming soon!
create clone of (myself v) Coming soon!
delete this clone Coming soon!

Sensing

Scratch Flop
<touching (mouse-pointer v)?> await sprite.touching("mouse")
<touching color[#0000ff]?> sprite.touchingColour([0,0,255]);
<color [#0000ff] is touching [#0000ff]?> sprite.colourTouchingColour([0,0,225],[0,0,225]);
(distance to (mouse-pointer v)) sprite.distanceTo("mouse");
ask [What's your name?] and wait See Javascript prompt function
(answer) See Javascript prompt function
<key(space v)pressed?> flop.keyPressed(" ");
<mouse down?> flop.mouseDown();
(mouse x) sprite.mouseX();
(mouse y) sprite.mouseY();
set drag mode [draggable v] Not implemented
(loudness) Not implemented
(timer) flop.timer()
reset timer flop.resetTimer()
[ v] of ( v) You can use sprite2.getX()within sprite1 code!
current [year v] See javascript Date.now() function
(days since 2000) See javascript Date.now() function
(username) Not implemented

Operaters, Variables, and My Blocks

All of the scratch blocks in these categories are built into Javascript, execpt one: (pick random (1) to (10)) Which is implemented with flop.operaters.pickRandom(1,10)